package xyz.qduwo.servlet.manager;

import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.ArrayList;
import java.util.HashMap;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import xyz.qduwo.entity.CatgoryEntity;
import xyz.qduwo.util.RespUtils;
import xyz.qduwo.dao.CategoryDao;

/**
 *
 * @author Administrator
 */
@WebServlet("/admin/manager/SelectType")
public class SelectType extends HttpServlet {

    List<CatgoryEntity> list_data = null;

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.setContentType("application/x-json;charset=utf-8");
        
        try {
            list_data = CategoryDao.findAll();
            resp.getWriter().println(RespUtils.success(list_data));
        } catch (Exception ex) {
            resp.getWriter().println(RespUtils.fail("error异常"));
        }
    }
}